package net.sareweb.acab.entity;

// Generated 13-abr-2010 15:53:20 by Hibernate Tools 3.2.5.Beta

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * Comment generated by hbm2java
 */
@Entity
@Table(name = "comment", catalog = "acab")
public class Comment implements java.io.Serializable {

	private Integer idComment;
	private Dialog dialog;
	private User user;
	private String msg;
	private Date createDate;

	public Comment() {
	}

	public Comment(Dialog dialog, User user, String msg, Date createDate) {
		this.dialog = dialog;
		this.user = user;
		this.msg = msg;
		this.createDate = createDate;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "idComment", unique = true, nullable = false)
	public Integer getIdComment() {
		return this.idComment;
	}

	public void setIdComment(Integer idComment) {
		this.idComment = idComment;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "dialog", nullable = false)
	@NotNull
	public Dialog getDialog() {
		return this.dialog;
	}

	public void setDialog(Dialog dialog) {
		this.dialog = dialog;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user", nullable = false)
	@NotNull
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "msg", nullable = false, length = 1000)
	@NotNull
	@Length(max = 1000)
	public String getMsg() {
		return this.msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "createDate", nullable = false, length = 0)
	@NotNull
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

}
